﻿#include "SqliteDatabase.h"

#include <QDebug>
#include <QThreadStorage>
#include <QString>
#include <QSqlError>
#include <QSqlQuery>

namespace Common {

	SqliteDatabase::SqliteDatabase(QObject *parent)
		: QObject(parent)
		, m_strDBName("")
	{

	}

	SqliteDatabase::~SqliteDatabase()
	{
		close(m_strDBName);
	}

	bool SqliteDatabase::open(QString strDBName)
	{
		return false;
	}

	bool SqliteDatabase::close(QString strDBName)
	{
		// 没有打开过数据库，不需要关闭
		if (m_strDBName.isEmpty())
		{
			return true;
		}

		return true;
	}

	QSqlDatabase SqliteDatabase::getDatabase(QString strDBName)
	{

		return QSqlDatabase();
	}

}